import type { AxiosRequestDynamicParameters } from '@/interfaces/NetworkData'

import { MIMEParams } from 'util';
import type { URLSearchParams } from 'url';

class AxiosDynamicConfig implements AxiosRequestDynamicParameters {

    constructor(method: 'get' | 'put' | 'post' | 'delete' | 'patch' | 'head', url: string, params?: URLSearchParams | Object) {
        this.method = method
        this.url = url
        this.params = params
    }
    method;
    url;
    params;
    readonly responseType = 'json';
    withCredentials = false;
    validateStatus = function (status: number) {
        return status >= 200 && status < 300; // 默认值
    };
    transformRequest(data: Object | unknown) {
        return data; // 默认值
    };
};


